/*
 * Copyright 2020 tu.cn All right reserved. This software is the
 * confidential and proprietary information of tu.cn ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with Tu.cn
 */
package com.onedec.schedule.serviceImpl;

import com.onedec.schedule.entity.OnedecSchedule;
import com.onedec.schedule.entity.OnedecScheduleExample;
import com.onedec.schedule.mapper.OnedecScheduleMapper;
import com.onedec.schedule.service.ScheduleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 31014
 * @date 2020/7/9 19:43
 */
@Service
public class ScheduleServiceImpl implements ScheduleService {
    @Resource
    private OnedecScheduleMapper onedecScheduleMapper;

    @Override
    public void insertSchedule(OnedecSchedule onedecSchedule) {
        onedecScheduleMapper.insert(onedecSchedule);
    }

    @Override
    public List<OnedecSchedule> selectSchedule(String empId) {
        final OnedecScheduleExample example = new OnedecScheduleExample();
        example.createCriteria().andScheduleBak1EqualTo(empId);
        final List<OnedecSchedule> schedules = onedecScheduleMapper.selectByExample(example);
        return schedules;
    }
}